using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ShootThemUp.Sources.GameElements;
using Microsoft.Xna.Framework;

namespace ShootThemUp.Sources.GameElements.Weapons
{
    /// <summary>
    /// This class represent a shot fired by a Weapon.
    /// </summary>
    public class Shot : MovableSprite
    {
        #region Fields

        /// <summary>
        /// The damage caused by this shoot.
        /// </summary>
        private int damages;
        /// <summary>
        /// The life time of this shot, ie the time left before his destruction.
        /// </summary>
        private float lifeTime;
        /// <summary>
        /// This boolean is true if this shot was fired by a fruit, false otherwise.
        /// </summary>
        private bool isEnnemyShot;

        #endregion

        #region Properties

        /// <summary>
        /// Gets or sets the damages of this shoot.
        /// </summary>
        /// <value>
        /// The damages.
        /// </value>
        public int Damages
        {
            get { return damages; }
            set { damages = value; }
        }

        /// <summary>
        /// Gets or sets the life time of this shot.
        /// </summary>
        /// <value>
        /// The life time of this shot.
        /// </value>
        public float LifeTime
        {
            get { return lifeTime; }
            set { lifeTime = value; } 
        }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is ennemy shot or not.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if this instance is ennemy shot; otherwise, <c>false</c>.
        /// </value>
        public bool IsEnnemyShot
        {
            get { return isEnnemyShot; }
            set { isEnnemyShot = value; }
        }

        #endregion

        #region Constructor

        /// <summary>
        /// Initializes a new instance of the <see cref="Shot"/> class.
        /// </summary>
        /// <param name="damages">The damages of this shot.</param>
        /// <param name="lifeTime">The life time of this shot.</param>
        /// <param name="position">The initial position of this shot.</param>
        /// <param name="speed">The speed of this shot.</param>
        /// <param name="rectangle">The rectangle to display in the spritesheet.</param>
        public Shot(int damages, float lifeTime, bool isEnnemyShot, Vector2 position, Vector2 speed, Rectangle rectangle) : base(position, speed, rectangle)
        {
            this.damages = damages;
            this.lifeTime = lifeTime;
            this.isEnnemyShot = isEnnemyShot;
        }

        #endregion
    }
}
